package com.sam.enumeration;

public enum PayrollDay {
	MONDAY, TUESDAY, WEDENSDAY, THURSDAY, FRIDAY, SATURADY, SUNDAY;

	private static final int HOURS_PER_SHIFT = 8;

	public double pay(double hoursWorked, double payRate) {

		double basePay = hoursWorked * payRate;

		double overtimePay;

		switch (this) {

		case SATURADY:
		case SUNDAY:

			overtimePay = hoursWorked * payRate / 2;
			break;
		default:
			overtimePay = hoursWorked <= HOURS_PER_SHIFT ? 0
					: (hoursWorked - HOURS_PER_SHIFT) * payRate / 2;
			break;
		}

		return basePay + overtimePay;

	}

	public static void main(String args[]) {

		System.out.println(PayrollDay.MONDAY.pay(8, 100));
		System.out.println(PayrollDay.SUNDAY.pay(8, 100));
	}

}
